// #include "../../../speech-sdk/aip-cpp-sdk-4.16.7/speech.h"



// void asr(aip::Speech &client)
// {
//     std::string file_content;
//     aip::get_file_content("16k.pcm", &file_content);

//     Json::Value result = client.recognize(file_content, "pcm", 16000, aip::null);
//     if (result["err_no"].asInt() != 0) {
//         std::cout << result["err_msg"].asString() << std::endl;
//         return;
//     }

//     std::cout << result["result"][0].asString() << std::endl;
// }

// int main()
// {
//     // 设置APPID/AK/SK
//     std::string app_id = "119239731";
//     std::string api_key = "DGVp5DPE9RhOpeI3f5ga0OeX";
//     std::string secret_key = "C9dHDbukhXMD63Uh6DaHRZcIzo1knKZ0";

//     aip::Speech client(app_id, api_key, secret_key);

//     asr(client);
//     return 0;
// }

#include "../../common/asr.hpp"
 
int main()
{
    InitLog(false);
    std::string app_id = "119239731";
    std::string api_key = "DGVp5DPE9RhOpeI3f5ga0OeX";
    std::string secret_key = "C9dHDbukhXMD63Uh6DaHRZcIzo1knKZ0";
    xu::ASRClient client(app_id,api_key,secret_key);

    std::string file_content;
    aip::get_file_content("16k.pcm", &file_content);

    std::string err_msg;
    LOG_DEBUG("语音识别结果：{}",client.Recognize(file_content,err_msg));

    return 0;
}